#include <cstdio>
#include <cstring>

int main() {
	const int MAX = 90;
	char ans[MAX][MAX];
	char str[MAX];
	int num1 = 0, num2 = 0;
	gets(str);

	int len = strlen(str);
	for (int i = 0; i < len; i++) {
		if (str[i] != ' ') {
			ans[num1][num2++] = str[i];
		} else {
			ans[num1++][num2] = '\0';
			num2 = 0;
		}
	}
	ans[num1][num2] = '\0';

	for (int i = num1; i >= 0; i--) {
		printf("%s", ans[i]);
		if (i != 0) printf(" ");
	}
	printf("\n");
	
	return 0;
}
